Firebase.AI
Summary
Enumerations |
|
---|---|
BlockReason{
|
enum A type describing possible reasons to block a prompt. |
ContentModality{
|
enum Content part modality. |
FinishReason{
|
enum Represents the reason why the model stopped generating content. |
HarmCategory{
|
enum Categories describing the potential harm a piece of content may pose. |
ResponseModality{
|
enum The response type the model should return with. |
Classes |
|
---|---|
Firebase. |
An object that represents a back-and-forth chat with a model, capturing the history and saving the context in memory between each message sent. |
Firebase. |
|
Firebase. |
A type that represents a remote multimodal model (like Gemini), with the ability to generate content based on various input types. |
Firebase. |
A live, generative AI model for real-time interaction. |
Firebase. |
Manages asynchronous communication with Gemini model over a WebSocket connection. |
Firebase. |
A |
Structs |
|
---|---|
Firebase. |
A struct representing a possible reply to a content generation prompt. |
Firebase. |
A struct describing a source attribution. |
Firebase. |
A collection of source attributions for a piece of content. |
Firebase. |
The model's response to a count tokens request. |
Firebase. |
Configuration for specifying function calling behavior. |
Firebase. |
Structured representation of a function declaration. |
Firebase. |
The model's response to a generate content request. |
Firebase. |
A struct defining model parameters to be used when sending generative AI requests to the backend model. |
Firebase. |
A struct defining model parameters to be used when generating live session content. |
Firebase. |
Content generated by the model in a live session. |
Firebase. |
Represents the response from the model for live content updates. |
Firebase. |
A request to use a tool from the live session. |
Firebase. |
A request to cancel using a tool from the live session. |
Firebase. |
Represents token counting info for a single modality. |
Firebase. |
A type describing data in media formats interpretable by an AI model. |
Firebase. |
A metadata struct containing any feedback the model had on the prompt it was provided. |
Firebase. |
Configuration parameters for sending requests to the backend. |
Firebase. |
A type defining potentially harmful media categories and their model-assigned ratings. |
Firebase. |
A type used to specify a threshold for harmful content, beyond which the model will return a fallback response instead of generated content. |
Firebase. |
A struct used to configure speech generation settings. |
Firebase. |
A helper tool that the model may use when generating responses. |
Firebase. |
|
Firebase. |
Token usage metadata for processing the generate content request. |
Interfaces |
|
---|---|
Firebase. |
Represents a message received from a live session. |
Enumerations
BlockReason
BlockReason
A type describing possible reasons to block a prompt.
Properties | |
---|---|
Blocklist
|
The prompt was blocked because it contained terms from the terminology blocklist. |
Other
|
All other block reasons. |
ProhibitedContent
|
The prompt was blocked due to prohibited content. |
Safety
|
The prompt was blocked because it was deemed unsafe. |
Unknown
|
A new and not yet supported value. |
ContentModality
ContentModality
FinishReason
FinishReason
Represents the reason why the model stopped generating content.
Properties | |
---|---|
Blocklist
|
Token generation was stopped because the response contained forbidden terms. |
MalformedFunctionCall
|
Token generation was stopped because the function call generated by the model was invalid. |
MaxTokens
|
The maximum number of tokens as specified in the request was reached. |
Other
|
All other reasons that stopped token generation. |
ProhibitedContent
|
Token generation was stopped because the response contained potentially prohibited content. |
Recitation
|
The token generation was stopped because the response was flagged for unauthorized citations. |
SPII
|
Token generation was stopped because of Sensitive Personally Identifiable Information (SPII). |
Safety
|
The token generation was stopped because the response was flagged for safety reasons. |
Stop
|
Natural stop point of the model or provided stop sequence. |
Unknown
|
A new and not yet supported value. |
HarmCategory
HarmCategory
Categories describing the potential harm a piece of content may pose.
Properties | |
---|---|
CivicIntegrity
|
Content that may be used to harm civic integrity. |
DangerousContent
|
Promotes or enables access to harmful goods, services, or activities. |
Harassment
|
Harassment content. |
HateSpeech
|
Negative or harmful comments targeting identity and/or protected attributes. |
SexuallyExplicit
|
Contains references to sexual acts or other lewd content. |
Unknown
|
A new and not yet supported value. |
ResponseModality
ResponseModality
The response type the model should return with.
Properties | |
---|---|
Audio
|
Public Experimental: Specifies that the model should generate audio data. Use this modality with a |
Image
|
Public Experimental: Specifies that the model should generate image data. Use this modality when you want the model to create visual content based on the provided input or prompts. The response might contain one or more generated images. See the image generation documentation for more details. Warning: Image generation using Gemini 2.0 Flash is a Public Experimental feature, which means that it is not subject to any SLA or deprecation policy and could change in backwards-incompatible ways. |
Text
|
Specifies that the model should generate textual content. Use this modality when you need the model to produce written language, such as answers to questions, summaries, creative writing, code snippets, or structured data formats like JSON. |